package com.fivium.bpd.editor;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JSplitPane;

import com.fivium.bpd.component.BusinessProcessDefinition;

public class QueryPanel extends JPanel
{

  /**
   * Create the panel.
   */
  public QueryPanel(BusinessProcessDefinition bpd)
  {
    setLayout(new BorderLayout(0, 0));
    
    JSplitPane container = new JSplitPane();
    add(container, BorderLayout.CENTER);
    
    JPanel queryListPanel = new QueryListPanel(bpd);
    container.setLeftComponent(queryListPanel);
    
    if (bpd.getQueryDefinitionList().size() > 0) {
      JPanel queryEditorPanel = new QuerySQLPanel();
      container.setRightComponent(queryEditorPanel);
    } else {
      JPanel emptyQueryEditorPanel = new JPanel();
      container.setRightComponent(emptyQueryEditorPanel);
    }

  }

}
